﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WSweb.Master" AutoEventWireup="true" CodeBehind="Novosti.aspx.cs" validateRequest="false" Inherits="WSweb.TEST" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" type="text/css" href="css/novosti.css" media="screen" />
    <!--[if IE 7]>
	    <style type="text/css">
	    .header-novosti { padding-top:0px; padding-bottom:50px }
	    </style>
    <![endif]-->
    <script type="text/javascript" src="js/font.js"></script> 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="fb-root"></div>
    <script type="text/javascript">
    (function (d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/hr_HR/all.js#xfbml=1&appId=194768950409";
        fjs.parentNode.insertBefore(js, fjs);
    } (document, 'script', 'facebook-jssdk'));
    </script>
    <script type="text/javascript">
        window.___gcfg = { lang: 'hr' }
        (function () {
            var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
            po.src = 'https://apis.google.com/js/plusone.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
        })();
    </script>
    <form id="form1" runat="server">
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DBwswebCS %>"
         SelectCommand="SELECT top 10 * FROM [Vijest] ORDER BY [id_vijest] DESC"></asp:SqlDataSource>
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" 
            onitemcommand="Repeater1_ItemCommand">
            <HeaderTemplate>
                <div class="header-novosti">
                    <span>Novosti</span>
                </div>
            </HeaderTemplate>
            <ItemTemplate>
            <div class="content-novosti">
                <a name="<%# Eval("id_vijest") %>"><asp:Literal ID="lit_id_vijest" runat="server" Text='<%# Eval("id_vijest") %>' Visible="false"/></a>
                <asp:TextBox ID="fld_naziv" runat="server" Text='<%# Eval("naziv") %>' Visible="false" />
                <h2><asp:Literal ID="lit_naziv" runat="server" Text='<%# Eval("naziv") %>' /></h2>
                <p>
                    <asp:Image ID="imageVijest" runat="server" Height="200" ImageUrl='<%# "imgHandler.ashx?id=" + Eval("image_id") %>' CssClass="novosti-img" /> 
                </p>
                <p>
                    <span><asp:Literal ID="lit_sadrzaj" runat="server" Text='<%# Eval("sadrzaj") %>' /></span>
                    <asp:TextBox ID="fld_sadrzaj" runat="server" Text='<%# Eval("sadrzaj") %>' Visible="false" />
                </p>
                <p class="content-novosti-inline">
                    <span class="novosti-font-size">Dodano: <%# Eval("datum") %> | <%# Eval("username") %></span>
                    <div class="fb-like" data-href='wsweb/Novosti.aspx#vijest<%# Eval("id_vijest") %>' data-send="true" data-layout="standard" data-width="650" data-show-faces="false" data-action="recommend" data-font="verdana"></div>
                    <span class="google-plus">
                        <g:plusone size="medium" annotation="none" href='wsweb.hr/Novosti.aspx#vijest<%# Eval("id_vijest") %>'></g:plusone>
                    </span><br />
                    <span>
                        <asp:LinkButton ID="lnk_Edit" runat="server" Text="Uredi" CommandName="EditThis" />
                        <asp:LinkButton ID="lnk_Cancel" runat="server" Text="Poništi" CommandName="CancelEdit" Visible="false" />
                    </span>
                </p>
            </div>
            </ItemTemplate>
        </asp:Repeater>
    </form>
</asp:Content>
